﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Black_Jack_Basic_Strategy
{
    class Card
    {
        public enum CardValues
        {   Ace,
            Two,
            Three,
            Four,
            Five,
            Six,
            Seven,
            Eight,
            Nine,
            Ten,
            Jack,
            Queen,
            King
        }

        public enum CardSuits
        {
            Spades,
            Hearts,
            Clubs,
            Diamonds
        }

        public CardValues Value { get; set; }
        public CardSuits Suit { get; set; }

        public bool IsAce
        {
            get
            {
                if (this.Value == CardValues.Ace)
                    return true;
                else
                    return false;
            }
        }


        public int GetCardValue(int CurrentTotal)
        {
            switch (this.Value)
            {
                case (CardValues.Ace):
                    {
                        if ((CurrentTotal + 11) > FormBlackJack.BUST_VALUE)
                            return 1;
                        else
                            return 11;
                    }
                case (CardValues.Eight):
                    {
                        return 8;
                    }
                case (CardValues.Five):
                    {
                        return 5;
                    }
                case (CardValues.Four):
                    {
                        return 4;
                    }
                case (CardValues.Jack):
                    {
                        return 10;
                    }
                case (CardValues.King):
                    {
                        return 10;
                    }
                case (CardValues.Nine):
                    {
                        return 9;
                    }
                case (CardValues.Queen):
                    {
                        return 10;
                    }
                case (CardValues.Seven):
                    {
                        return 7;
                    }
                case (CardValues.Six):
                    {
                        return 6;
                    }
                case (CardValues.Ten):
                    {
                        return 10;
                    }
                case (CardValues.Three):
                    {
                        return 3;
                    }
                case (CardValues.Two):
                    {
                        return 2;
                    }
                default:
                {
                    return 0;
                }
            }
        }
    }
}
